package formulation;
public class Disco implements Cloneable
{
	private int size;
	
	public Disco(int size)
	{
		this.size = size;
	}
	
	@Override 
	public String toString()
	{
		return "Disco de tama\u00f1o: " + this.size;
	}
	
	@Override
	protected Object clone() throws CloneNotSupportedException
	{
		Object clon = null;
		
		try
		{
			clon = super.clone();			
		}
		catch (CloneNotSupportedException e) 
		{
			System.err.println("% [ERROR] Disco.clone(): " + e.getMessage());
		}
		
		return clon;	
	}
	
	@Override 
	public boolean equals(Object obj)
	{
		if(obj != null && obj instanceof Disco)
		{
			Disco disco = (Disco) obj;
			return disco.getSize() == this.getSize();
		}
		else
		{
			return false;
		}
	}
	
	public int getSize()
	{
		return size;
	}	
	
	public void setSize(int size)
	{
		this.size = size;
	}
}